#pragma once
#include <vector>
#include <string>
#include <map>
#include <iostream>
#include <fstream>
using namespace std;

class grammatical
{
public:
	vector<pair<string, string>> words;
	vector<pair<string, string>> output;
	map<string, int> dict;
	vector<string> str;
	void bootGrammatical();
	void rollback(int);
	pair<int, bool> tryMatch(string, int, int);
	pair<int, bool> matchMultiple(string, int);
	pair<int, bool> matchType(int, int);
	vector<pair<string, string>> resolve(vector<pair<string, string>>);
};
